package oo

import "fmt"

type Dog struct {
	name string
	age  int8
}

func (dog Dog) Wang() {
	fmt.Printf("%p  dog  copy Wang()!!\n", &dog)
}

func (dog *Dog) WangP() {
	fmt.Printf("%p  dog WangP()!!\n", dog)
}


func RunTestP(){
	dog := Dog{
		name: "wangwang",
		age: 2,
	}
	fmt.Printf("---------------------------- %p\n",&dog)
	dog.Wang()
	//指针可以直接调对象的方法,对象不可直接调指针的方法。因为附加参数也是值传递
	(&dog).WangP()

}